<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ page import="cn.edu.scau.yangchunmei.bean.User"%>
<%@ page import="java.util.*"%>
<%@ page import="java.sql.Connection"%>
<%@ page import="java.sql.DriverManager"%>
<%@ page import="java.sql.ResultSet"%>
<%@ page import="java.sql.SQLException"%>
<%@ page import="java.sql.Statement"%>
<%@ page import="java.util.ArrayList"%>
<%@ page import="java.util.List"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>登录界面</title>
</head>
<body>
	<jsp:useBean id="zhangshan" class="cn.edu.scau.yangchunmei.bean.User">
		<jsp:setProperty name="zhangshan" property="*" />
	</jsp:useBean>
	<jsp:getProperty property="username" name="zhangshan" />
	<jsp:getProperty property="password" name="zhangshan" />
	<p></p>
	<a href="studentOperation.jsp">查看学生的详细信息</a>
	<p></p>
	<a href="changeOwnInformation.jsp">修改个人的自己信息</a>
	<p></p>
	<a href="studentListResult.jsp">查看所有学生的列表</a>
	<%
		Class.forName("com.mysql.jdbc.Driver");

		String url = "jdbc:mysql://localhost:3306/jsp";
		String username = "root";
		String password = "root";
		Connection conn = DriverManager.getConnection(url, username, password);
		Statement stmt = conn.createStatement(); // 获取Statement
		ResultSet rs = stmt
				.executeQuery("select* from tb_User where username='+username+' and password='+password+'");
		if (rs.next()) {
			request.setAttribute("right", "登录成功");
		} else {
			request.setAttribute("error", "您输入的用户名和密码不正确");

		}
	%>
</body>
</html>